<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Lottery</title>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"></script>
    <link rel="stylesheet" href="/static/lotterydir/cards.css">
    <script type="text/javascript" src="/static/lotterydir/js/lottery.js"></script>
</head>
<body scroll="no" style="margin:0;padding:0;overflow:hidden">

<div class="earththreeanimation">
<iframe name="bg_frame" marginwidth=0 marginheight=0 width="100%" height="100%" src="/static/lotterydir/3D_show/index.html" frameborder=0 scroll="no"></iframe>
</div>

<div id='bgpic'></div>

<div class="lotterymodel">
    <div class="lotteryshow"></div>
    <div id="lotteryresultid" class="lotteryresult"></div>
</div>

<script type="text/x-template" id="avard-record-card-tmpl">
    <div class="wrapper" style="background-image: url(/static/lotterydir/img/cardone.png); background-size: cover;">
        <img class="photo" >
        <div class="textdes"></div>
        <div class="greetings"></div>
    </div>
</script>

<script type="text/javascript">

    $(document).keydown(function(event) {
        console.log(event.keyCode);

        if(event.ctrlKey && event.keyCode === 32){//ctrl+space
            console.log('show result');
            Lottery.showResult();
            Lottery.stopRandomPicAnimation();
        }

        if(event.ctrlKey && event.keyCode === 113){//ctrl+F2
            if(Lottery.isOpenLottery){
                console.log('close lottery');
                Lottery.isOpenLottery = false;
            }else {
                console.log('open lottery');
                Lottery.isOpenLottery = true;
            }
        }


        if(event.shiftKey && event.ctrlKey){
            if(!Lottery.isOpenLottery){//未打开抽奖状态
                return;
            }
            if(Lottery.isStartLottery) {//正在抽奖中...
                return;
            }
            switch (event.keyCode){
                case 49:
                    console.log('alt+shift+1')
                    Lottery.onEvent(1,0);
                    break;
                case 50:
                    console.log('alt+shift+2')
                    Lottery.onEvent(2,1);
                    break;
                case 51:
                    console.log('alt+shift+3')
                    Lottery.onEvent(3,2);
                    break;
                case 52:
                    console.log('alt+shift+4')
                    Lottery.onEvent(4,3);
                    break;
            }
        }

        if(event.ctrlKey && event.keyCode === 81){
            console.log('refresh setting');
            Lottery.getLotterySetting();
            Lottery.getSignPersonInfo();
            Lottery.getWinnersInfo();
        }


    });

    Lottery.getLotterySetting();
    Lottery.getSignPersonInfo();
    Lottery.getWinnersInfo();


</script>

</body>
</html>